from pydantic import BaseModel, Field
from typing import Optional, List, Dict, Any, Union

class RPCRequest(BaseModel):
    jsonrpc: str = Field("2.0", const=True)
    id: Union[int, str]
    method: str
    params: Optional[Dict[str, Any]] = None

class RPCResponse(BaseModel):
    jsonrpc: str = Field("2.0", const=True)
    id: Union[int, str]
    result: Optional[Dict[str, Any]] = None
    error: Optional[Dict[str, Any]] = None

class RecordMemoryRequest(BaseModel):
    thinking: str
    content: List[str]
    memory_type: Optional[str] = None
    infer: Optional[bool] = True

class RetrieveMemoryRequest(BaseModel):
    keywords: List[str]
    limit: Optional[int] = 5

class MemoryConfig(BaseModel):
    agent_name: Optional[str] = None
    user_name: Optional[str] = None
    run_name: Optional[str] = None
    default_memory_type: Optional[str] = None
    on_disk: Optional[bool] = True